package com.sg.service.impl;

import com.sg.bean.ComandOrder;
import com.sg.dao.ComandOrderDao;
import com.sg.service.ComandOrderService;
import com.sg.vo.ComandOrderVO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fyp
 * 订单商品关系业务逻辑实现类
 */
@Service
public class ComandOrderServiceImpl implements ComandOrderService {
    Logger logger=Logger.getLogger(ComandOrderServiceImpl.class);
    @Autowired
    ComandOrderDao comandOrderDao;
    @Override
    public List<ComandOrderVO> findAll() {
        return comandOrderDao.findAll();
    }

    @Override
    public ComandOrder findById(int coId) {
        return comandOrderDao.findById(coId);
    }

    @Override
    public boolean add(ComandOrder comandOrder) {
        return comandOrderDao.add(comandOrder)>0?true:false;
    }

    @Override
    public boolean delete(int coId) {
        return comandOrderDao.delete(coId)>0?true:false;
    }

    @Override
    public boolean update(ComandOrder comandOrder) {
        return comandOrderDao.update(comandOrder)>0?true:false;
    }

    @Override
    public List<ComandOrderVO> findList(int orderId) {
        return comandOrderDao.findList(orderId);
    }
}
